#include <stdio.h>
#define ROWS 3
#define COLS 5
void arr_set(double arr[][COLS], int rows);
double arr_aver(double arr[][COLS], int rows);
double arr_max(double arr[][COLS], int rows);
int main(void)
{
	double user_arr[ROWS][COLS];
	double average,max;
	
	arr_set(user_arr, ROWS);
	average = arr_aver(user_arr, ROWS);
	max = arr_max(user_arr, ROWS);
	
	printf("average = %0.2lf, max = %0.2lf", average, max);
	
	return 0;	
}
void arr_set(double arr[][COLS], int rows)
{
	int i,j;
	for(i=0; i<rows; i++)
		for(j=0; j<COLS; j++)
			scanf("%lf", &arr[i][j]);
}
double arr_aver(double arr[][COLS], int rows)
{
	int i,j;
	double aver,total=0;
	for(i=0; i<rows; i++)
		for(j=0; j<COLS; j++)
			total+=arr[i][j];
	aver = total/(ROWS*COLS);
	
	return aver;
}
double arr_max(double arr[][COLS], int rows) 
{
	int i,j;
	double max = 0;
	for(i=0; i<rows; i++)
		for(j=0; j<COLS; j++)
			if(arr[i][j]>max)
				max = arr[i][j];
	
	return max;
}
